<template>
	<view class="nodata" @click="click">
		<image :src="baseImg" mode="widthFix" class="empty_image"></image>
		<text :style="{color:textColor}">{{ text }}</text>
	</view>
</template>

<script>
	export default {
		name: 'xw-empty',
		props: {
			//text
			text: {
				type: String,
				default: '暂无数据,点击刷新'
			},
			img: {
				type: String,
				default: '/static/nodata.png'
			},
			textColor: {
				type: String,
				default: '#999999'
			},
			onClick: {
				type: Function,
				default: null
			}
		},
		data() {
			return {
				baseImg: ''
			};
		},
		methods: {
			click() {
				this.$emit('refresh')
			}
		}
	};
</script>

<style lang="scss">
	.nodata {
		display: flex;
		flex-direction: column;
		justify-content: center;
		height: 400rpx;
		width: 100%;
		align-items: center;
		color: #555555;
		font-size: 24rpx;

	}

	.empty_image {
		width: 200rpx !important;
		margin-bottom: 50rpx;
	}
</style>
